1. Technical Field
This invention generally relates to the data processing field. More specifically, this invention relates to the field of modifying objects in an object-oriented system.
2. Background Art
The development of the EDVAC computer system of 1948 is often cited as the beginning of the computer era. Since that time computers have become indispensable in many fields of human endeavor including engineering design, machine and process control, and information storage and access. One of the primary uses of computers is for information storage and retrieval.
Database systems have been developed that allow a computer to store a large amount of information in a way that allows a user to search for specific information in the database. For example, an insurance company may have a database that includes all of its policy holders and their current account information, including payment history, premium amount, policy number, policy type, exclusions to coverage, etc. A database system allows the insurance company to retrieve the account information for a single policy holder among the thousands and perhaps millions of policy holders in its database. A database manager within the database system is responsible for storing and retrieving all information in the database in a way that allows random access to any policy holder within the database. One way for the database manager to store and retrieve information for policy holders is to build a data structure that correlates database entries to their location in the database. One example of such a data structure is an index of policy holders. An index correlates policy holders to the records in the database that contain the information that corresponds to the policy holders. Thus, when a new entry is created in the database, the database manager creates an entry in the index that corresponds to the new entry, and that identifies the location of the information in the database. In this way, when the information for a specific policy holder is required, the index is searched, and when the proper policy holder is found in the index, data is read that indicates the location in the database of the information for that particular policy holder.
Modern database management techniques make possible relational databases that have very powerful storage and retrieval mechanisms. When information needs to be added to a database, a database manager creates one or more records in the database, stores the information in the record(s), and update any indexes or other data structures to reflect the new data. The database manager thus assures that all indexes or other data structures that correlate to the data stored in the database are updated as required when changes are made to data in the database, but does so at the expense of significant overhead in storing and retrieving data to and from the database.
Advances in computer hardware and software have pushed the performance of modern computer systems to higher limits. One of the recent advances in the field of software development has been the emergence of object oriented programming technology. The goal of using object-oriented programming is to create small, reusable sections of program code known as objects that can be quickly and easily combined and re-used to create new programs. This is similar to the idea of using the same set of building blocks again and again to create many different structures. The modular and re-usable aspects of objects will typically speed development of new programs, thereby reducing the costs associated with the development cycle. In addition, by creating and re-using a group of well-tested objects, a more stable, uniform, and consistent approach to developing new computer programs can be achieved.
An object in an object-oriented computer program typically has attributes defined by state data that determine how the object will behave. When a program changes an object's state data, data structures that correspond to the object must be updated to reflect the change. For example, if an employee gives birth to a child, changing the employee object to include the name of the child should cause a corresponding change in an index that tracks the number of dependents that each employee has. In the database realm, a change to the database is made by the database manager, which also updates the data structures to reflect the change. However, in an object oriented realm, many different objects may make changes to a particular object, and there is currently no architected mechanism in place to assure that data structures are updated when an object is changed.
One approach to assuring that changes to an object are reflected in corresponding data structures is to require a programmer to write his or her program in a way that updates all data structures whenever an object is changed. For example, special code could be added into every method that changes an object's data to signal index maintenance code to update the indexes with the change that was just made. However, this approach puts too much of a burden on the programmer. Furthermore, the programmer may forget or choose not to implement these requirements into the code, so the index updating is only as reliable as the programmer. It is more desirable to have the system keep track of updating indexes, which would relieve the programmer of these programming constraints, and would also assure that data structures are automatically updated when an object is changed in a manner that is transparent to the programmer.
Another approach is to put all index maintenance code in the object infrastructure code, thereby assuring that changes to objects are reflected in the corresponding data structures. However, this approach requires excessive development resources, because the object infrastructure code would have to provide a language to describe logical conditions for selecting and omitting objects, for creating computed key fields, etc. In addition, this approach imposes too many policy and implementation details into the object infrastructure code. Furthermore, this approach would not allow programmers to modify the way that changes to objects are reflected in the corresponding data structures. Without a simple, flexible, user-extensible mechanism for automatically changing data structures such as an index when an object is changed, the computer industry will continue to suffer from object oriented systems that either impose excessive requirements on programmers, or that provide excessively rigid code in the object infrastructure.